<template>
	<view class="enroll-view">
		<view class="templet-view col-arrange  center-view">
			<text class="templet-title ">{{title}}</text>
			<text class="templet-intro">{{intro}}</text>
			<zEnrollItemPanel class="templet-board" :questions="questions"/>
		</view>	
	</view>
</template>


<script>
	import zEnrollItemPanel from "../../components/basic/zenrollitempanel";
	export default {
		components : {
			zEnrollItemPanel
		},
		data: function () {
			return {
				title : "",
				intro : "",
				questions : [],
				isPub : false
			}
		},
		onLoad : function(option){
			// console.log(this.enrollData.checked)
			// this.users.push({'username':'test','name':'test','intro':'this is a suck introduction.','status':'success'})
			var param = {'id':option.id};
			// console.log(param)
			var vm = this;
			this.$get(this.enrollurl + '/enroll/getTemplet',param,function(res){
				console.log(res)
				var object = res.data.object;
				vm.title = object.title;
				vm.intro = object.intro;
				vm.questions = JSON.parse(object.content);
				vm.isPub = object.status == 1;
			});
			// this.intro = "测试简介"
			// this.questions = [{"question":"您的年龄？","key":"q1","type":"ztext","answer":{"restrict":0,"length":2,"empty":true}},
            //     {"question":"您的性别？","key":"q4","type":"zradio","answer":{"choices":["男","女"],"empty":false}}]
		},
		methods: {
			submit : function(){
				
			},
			getUser : function(){
				
			}
		}
	}
</script>

<style>
	@import "../../common/zcss.css";
	.enroll-view{
		width: 100%;
		flex-direction: column;
	}
	.center-view{
		width:100%;
		display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
	}
	.templet-title{
		font-size: 50upx;
	}
	.templet-intro{
		font-size: 30upx;
	}
	.templet-board{
		width: 97%;
	}
	
</style>
